package ar.unq.edu.svnpermission.utils;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateHelper {
	
	public static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
	
	/**
	 * Convierte un string de formato "yyyy/MM/dd" a un objeto Date
	 * @param dateString String
	 * @return Date
	 * @throws ParseException String
	 */
	public static Date fromStringToDate(String aString) throws ParseException{
		Date date = null;	
		date = dateFormat.parse(aString);
		return date;
	}
	
	public static String fromDateToString(Date aDate){
		return dateFormat.format(aDate);
	}
}
